// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0 !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t,n){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n=0}function v(e,t){var n=window["HTML".concat(e,"Element")];if(void 0!==n){var o=Object.getOwnPropertyDescriptor(n.prototype,t);void 0!==o&&Object.defineProperty(n.prototype,"_wm_".concat(t),o)}}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"src",n="_wm_".concat(t);return n in e.__proto__?e[n]:e[t]}v("Image","src"),v("Media","src"),v("Embed","src"),v("IFrame","src"),v("Script","src"),v("Link","href"),v("Anchor","href")},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var o=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i={Y:function(e){return e.getUTCFullYear()},m:function(e){return e.getUTCMonth()+1},b:function(e){return r[e.getUTCMonth()]},B:function(e){return o[e.getUTCMonth()]},d:function(e){return e.getUTCDate()},H:function(e){return("0"+e.getUTCHours()).slice(-2)},M:function(e){return("0"+e.getUTCMinutes()).slice(-2)},S:function(e){return("0"+e.getUTCSeconds()).slice(-2)},"%":function(){return"%"}};function s(e){var t=function(e){return"number"==typeof e&&(e=e.toString()),[e.slice(-14,-10),e.slice(-10,-8),e.slice(-8,-6),e.slice(-6,-4),e.slice(-4,-2),e.slice(-2)]}(e);return new Date(Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5]))}function a(e){return r[e]}function c(e,t){return t.replace(/%./g,(function(t){var n=i[t[1]];return n?n(s(e)):t}))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var o=n(0);function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n=400?r.failure&&r.failure(e):r.success&&r.success(e)}),{"Content-Type":"application/json"},s.stringify({url:e,snapshot:t,tags:n||[]})),!1}var c=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.el=t,this.url=n,this.timestamp=r,t.onclick=this.save.bind(this),document.addEventListener("DOMContentLoaded",(function(){i.enableSaveSnapshot(Object(o.c)("logged-in-user"))}))}var t,n,r;return t=e,(n=[{key:"save",value:function(e){this.start(),a(this.url,this.timestamp,[],{failure:this.failure.bind(this),success:this.success.bind(this)})}},{key:"start",value:function(){this.hide(["wm-save-snapshot-fail","wm-save-snapshot-open","wm-save-snapshot-success"]),this.show(["wm-save-snapshot-in-progress"])}},{key:"failure",value:function(e){401==e.status?this.userNotLoggedIn(e):(this.hide(["wm-save-snapshot-in-progress","wm-save-snapshot-success"]),this.show(["wm-save-snapshot-fail","wm-save-snapshot-open"]),console.log("You have got an error."),console.log("If you think something wrong here please send it to support."),console.log('Response: "'+e.responseText+'"'),console.log('status: "'+e.status+'"'))}},{key:"success",value:function(e){this.hide(["wm-save-snapshot-fail","wm-save-snapshot-in-progress"]),this.show(["wm-save-snapshot-open","wm-save-snapshot-success"])}},{key:"enableSaveSnapshot",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e?(this.show("wm-save-snapshot-open"),this.hide("wm-sign-in")):(this.hide(["wm-save-snapshot-open","wm-save-snapshot-in-progress"]),this.show("wm-sign-in"))}},{key:"show",value:function(e){this.setDisplayStyle(e,"inline-block")}},{key:"hide",value:function(e){this.setDisplayStyle(e,"none")}},{key:"setDisplayStyle",value:function(e,t){var n=this;(Object(o.d)(e)?e:[e]).forEach((function(e){var o=n.el.getRootNode().getElementById(e);o&&(o.style.display=t)}))}}])&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},,,,,,,function(e,t,n){"use strict";var o;n.r(t);var r,i={createElementNS:document.createElementNS};var s=!0;function a(e){!function(e,t,n){if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3);var r="; expires="+o.toGMTString()}else r="";document.cookie=e+"="+t+r+"; path=/"}(e,"",-1)}var c=n(0),l=n(1),u=window.Date;function f(e,t){return(e=e.toString()).length>=t?e:"00000000".substring(0,t-e.length)+e}function h(e){for(var t=0,n=0;n3}(e)){var o=[];for(n=0;n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:"src",i=window.location.origin,s=w(window,e),l=p(s);try{for(l.s();!(o=l.n()).done;){var u=o.value;if(!n||n(u)){var f=Object(c.b)(u,r);f&&!f.startsWith(t)&&f.startsWith(i)&&(f.startsWith("data:")||a.push(f))}}}catch(e){l.e(e)}finally{l.f()}}u("img"),u("frame"),u("iframe",(function(e){return"playback"!==e.id})),u("script"),u("link",(function(e){return"stylesheet"===e.rel}),"href");var f=a.filter((function(e,t,n){return n.indexOf(e)===t}));f.length>0?(s=0,f.map((function(e){e.match("^https?://")&&(s++,Object(c.a)("HEAD",e,(function(e){if(200==e.status){var t=e.getResponseHeader("Memento-Datetime");if(null==t)console.log("%s: no Memento-Datetime",u);else{var n=document.createElement("span"),a=function(e,t){var n=new Date(e).getTime()-t,o="";n<0?(o+="-",n=Math.abs(n)):o+="+";var r=!1;if(n<1e3)return{delta:n,text:"",highlight:r};var i=n,s=Math.floor(n/1e3/60/60/24/30/12);n-=1e3*s*60*60*24*30*12;var a=Math.floor(n/1e3/60/60/24/30);n-=1e3*a*60*60*24*30;var c=Math.floor(n/1e3/60/60/24);n-=1e3*c*60*60*24;var l=Math.floor(n/1e3/60/60);n-=1e3*l*60*60;var u=Math.floor(n/1e3/60);n-=1e3*u*60;var f=Math.floor(n/1e3),h=[];s>1?(h.push(s+" years"),r=!0):1==s&&(h.push(s+" year"),r=!0);a>1?(h.push(a+" months"),r=!0):1==a&&(h.push(a+" month"),r=!0);c>1?h.push(c+" days"):1==c&&h.push(c+" day");l>1?h.push(l+" hours"):1==l&&h.push(l+" hour");u>1?h.push(u+" minutes"):1==u&&h.push(u+" minute");f>1?h.push(f+" seconds"):1==f&&h.push(f+" second");h.length>2&&(h=h.slice(0,2));return{delta:i,text:o+h.join(" "),highlight:r}}(t,i),c=a.highlight?"color:red;":"";n.innerHTML=" "+a.text,n.title=t,n.setAttribute("style",c);var l=e.getResponseHeader("Content-Type"),u=e.responseURL.replace(window.location.origin,""),f=document.createElement("a");f.innerHTML=u.split("/").splice(3).join("/"),f._wm_href=u,f.title=l,f.onmouseover=g,f.onmouseout=b;var h=document.createElement("div");h.setAttribute("data-delta",a.delta),h.appendChild(f),h.append(n),o.appendChild(h);var p=Array.prototype.slice.call(o.childNodes,0);p.sort((function(e,t){return t.getAttribute("data-delta")-e.getAttribute("data-delta")})),o.innerHTML="";for(var d=0,m=p.length;d0)for(var n=0;n0)for(var n=0;n0?this.sc.scrollTop=r+this.sc.suggestionHeight+o-this.sc.maxHeight:r<0&&(this.sc.scrollTop=r+o)}}},{key:"blurHandler",value:function(){var e=this;try{var t=this.root.querySelector(".wb-autocomplete-suggestions:hover")}catch(e){t=null}t?this.input!==document.activeElement&&setTimeout((function(){return e.focus()}),20):(this.last_val=this.input.value,this.sc.style.display="none",setTimeout((function(){return e.sc.style.display="none"}),350))}},{key:"suggest",value:function(e){var t=this.input.value;if(this.cache[t]=e,e.length&&t.length>=this.minChars){for(var n="",o=0;o40)&&13!=n&&27!=n){var o=this.input.value;if(o.length>=this.minChars){if(o!=this.last_val){if(this.last_val=o,clearTimeout(this.timer),this.cache){if(o in this.cache)return void this.suggest(this.cache[o]);for(var r=1;r'+e.replace(n,"$1")+""}},{key:"onSelect",value:function(e,t,n){}}]),e}(),H=function(){function e(t,n){T(this,e);var o=t.getRootNode();if(o.querySelector){var r="object"==S(t)?[t]:o.querySelectorAll(t);this.elems=r.map((function(e){return new E(e,n)}))}}return _(e,[{key:"destroy",value:function(){for(;this.elems.length>0;)this.elems.pop().unload()}}]),e}(),j=n(2);function L(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n0&&i<60,i)}))}window.__wm={init:function(e){!function(){var e=document.cookie.split(";");if(e.length>40)for(var t=0;t1?t-1:0),o=1;o0;)O.appendChild(k.children[0]);if(d)for(var E=0;E'+((""+n).replace(/\B(?=(\d{3})+$)/g,",")+" ")+(n>1?"captures":"capture")+"",h=l.a(r,"%d %b %Y");s!=r&&(h+=" - "+l.a(s,"%d %b %Y")),f+='
'+h+"
",t.innerHTML=f}(o),function(e,t,n,o,r,i,s){var a=o.getContext("2d");if(a){a.fillStyle="#FFF";var c=(new u).getUTCFullYear(),l=t/(c-r+1),f=h(e.years),p=f[0],d=n/f[1];if(i>=r){var m=_(i);a.fillStyle="#FFFFA5",a.fillRect(m,0,l,n)}for(var v=r;v<=c;v++){m=_(v);a.beginPath(),a.moveTo(m,0),a.lineTo(m,n),a.lineWidth=1,a.strokeStyle="#CCC",a.stroke()}s=parseInt(s)-1;for(var y=(l-1)/12,g=0;g0){var M=Math.ceil(T*d);a.fillStyle=v==i&&S==s?"#EC008C":"#000",a.fillRect(Math.round(w),Math.ceil(n-M),Math.ceil(y),Math.round(M))}w+=y}}}function _(e){return Math.ceil((e-r)*l)+.5}}(o,e,t,oe,a,T,M)}}))}else{var ie=new Image;ie.src="/__wb/sparkline?url="+encodeURIComponent(i)+"&width="+e+"&height="+t+"&selected_year="+T+"&selected_month="+M+(r&&"&collection="+r||""),ie.alt="sparkline",ie.width=e,ie.height=t,ie.id="sparklineImgId",ie.border="0",ne.parentNode.replaceChild(ie,ne)}function se(e){for(var t=[],n=e.length,o=0;o0)try{var o=document.createElement("div");o.setAttribute("style","background-color:#666;color:#fff;font-weight:bold;text-align:center"),o.textContent="NOTICE";var r=document.createElement("div");r.className="wm-capinfo-content";var i,s=L(n);try{for(s.s();!(i=s.n()).done;){var a=i.value;if("string"==typeof a.notice){var c=document.createElement("div");c.innerHTML=a.notice,r.appendChild(c)}}}catch(e){s.e(e)}finally{s.f()}ae.appendChild(o),ae.appendChild(r),Y(!0)}catch(e){console.error("failed to build content of %o - maybe notice text is malformed: %s",ae,n)}}))}else Y(!0);new j.a(F("wm-save-snapshot-open"),i,W)},ex:function(e){e.stopPropagation(),Y(!1)},ajax:c.a,sp:function(){return X}}}]); // @license-end